package com.yss.reportworld.domain.rule;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.yss.common.core.annotation.EasyExcel;
import com.yss.common.core.annotation.ExcelValid;
import com.yss.common.core.utils.easyexecl.IntegerConverter;
import com.yss.common.core.utils.easyexecl.StringConverter;
import io.swagger.models.auth.In;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotNull;

/**
 * 数据源配置_数据集_出参对象 rw_db_r_check_sql_out_parameter
 *
 * @author yss
 * @date 2023-07-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("rw_db_r_check_sql_out_parameter")
public class RCheckSqlOutParameter extends Model<RCheckSqlOutParameter> {
    public static final String SHEET_NAME = "出参表";
    /**
     * ID
     */
    @ExcelIgnore
    @TableId("ID")
    private String id;

    @NotNull(message = "校验对象不可为空")
    @ExcelProperty({"出参表", "校验对象"})
    @ExcelValid(message = "【出参表】【出参表】【校验对象】不能为空")
    private String checkCode;
    /**
     * 参数code
     */
    @ExcelProperty({"出参表", "参数code"})
    @TableField("CODE")
    @ExcelValid(message = "【出参表】【出参表】【参数code】不能为空")
    private String code;
    /**
     * 参数中文名
     */
    @ExcelProperty({"出参表", "参数中文名"})
    @TableField("NAME")
    @ExcelValid(message = "【出参表】【出参表】【参数中文名】不能为空")
    private String name;
    /**
     * 参数类型（string,integer）
     */
    @ExcelProperty(value = {"出参表", "参数类型"}, converter = IntegerConverter.class)
    @EasyExcel(readConverterExp = "0=字符串,1=整型数字,2=浮点型数字,3=日期,4=时间,5=日期+时间,6=对象,7=布尔,8=常量,9=引用表")
    @TableField("TYPES")
    @ExcelValid(message = "【出参表】【出参表】【参数类型】不能为空")
    private Integer types;

    /**
     * 是否主键
     */
    @ExcelProperty(value = {"出参表", "是否主键"}, converter = IntegerConverter.class)
    @EasyExcel(readConverterExp = "0=否,1=是")
    @TableField("PK_FLAG")
    @ExcelValid(message = "【出参表】【出参表】【是否主键】不能为空")
    private Integer pkFlag;

    /**
     * 函数名称(SUM,MIN,MAX,AVG)
     */
    @ExcelProperty(value = {"多表关联-分组", "分组函数"}, converter = StringConverter.class)
    @EasyExcel(readConverterExp = "MAX=最大值,AVG=平均值,SUM=求和,MIN=最小值,COUNT=计数")
    @TableField("FX_NAME")
    private String fxName;

    /**
     * 引用校验标识
     */
    @ExcelProperty({"多表关联-分组", "子校验对象识别码"})
    @TableField("REF_CHECK_CODE")
    private String refCheckCode;

    /**
     * 参数分类ID
     */
    @ExcelIgnore
    @TableField("PARAMETER_TYPE_ID")
    private String parameterTypeId;


    /**
     * 常量分类ID
     */
    @ExcelIgnore
    @TableField("CONSTANT_TYPE_ID")
    private String constantTypeId;


    /**
     * 引用校验对象中文名
     */
    @ExcelIgnore
    @TableField("REF_DESCRIBES")
    private String refDescribes;


    /**
     * 引用校验对象ID
     */
    @ExcelIgnore
    @TableField("REF_CHECK_OBJECT_ID")
    private String refCheckObjectId;


    /**
     * 字段别名
     */
    @ExcelIgnore
    @TableField("AS_NAME")
    private String asName;
    /**
     * 数据集表_外键
     */
    @ExcelIgnore
    @TableField("DATASET_ID")
    private String datasetId;


    /**
     * 排序
     */
    @ExcelIgnore
    @TableField("SORTS")
    private Integer sorts;

    /**
     * 默认值？
     */
    @ExcelIgnore
    @TableField("DEFAULT_VAL")
    private String defaultVal;

    /**
     * 创建人
     */
    @ExcelIgnore
    @TableField("CREATE_USER")
    private String createUser;

    /**
     * 修改人
     */
    @ExcelIgnore
    @TableField("UPDATE_USER")
    private String updateUser;

    /**
     * 状态(逻辑删除状态)
     */
    @ExcelIgnore
    @TableField("STATUS")
    private Integer status;

    /**
     * 校验对象ID_外键
     */
    @ExcelIgnore
    @TableField("CHECK_OBJECT_ID")
    private String checkObjectId;

    /**
     * 数据编码
     */
    @ExcelIgnore
    @TableField("RW_DB_ID")
    private String rwDbId;

}
